home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / robinson / frmmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-12-05  |  3.0 KB  |  100 lines

  1. VERSION 2.00
  2. Begin Form frmMain 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Explicit vs. Variants"
  5.    ClientHeight    =   2970
  6.    ClientLeft      =   1095
  7.    ClientTop       =   1485
  8.    ClientWidth     =   4275
  9.    Height          =   3375
  10.    Left            =   1035
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   2970
  13.    ScaleWidth      =   4275
  14.    Top             =   1140
  15.    Width           =   4395
  16.    Begin CommandButton cmdShowDlg 
  17.       Caption         =   "Explicit"
  18.       Height          =   495
  19.       Index           =   1
  20.       Left            =   1620
  21.       TabIndex        =   5
  22.       Top             =   2160
  23.       Width           =   1215
  24.    End
  25.    Begin CommandButton cmdShowDlg 
  26.       Caption         =   "Variant"
  27.       Height          =   495
  28.       Index           =   0
  29.       Left            =   1620
  30.       TabIndex        =   4
  31.       Top             =   1500
  32.       Width           =   1215
  33.    End
  34.    Begin TextBox txtUserInfo 
  35.       Height          =   315
  36.       Index           =   1
  37.       Left            =   1260
  38.       TabIndex        =   2
  39.       Top             =   765
  40.       Width           =   1395
  41.    End
  42.    Begin TextBox txtUserInfo 
  43.       Height          =   315
  44.       Index           =   0
  45.       Left            =   1260
  46.       TabIndex        =   0
  47.       Top             =   285
  48.       Width           =   2880
  49.    End
  50.    Begin Label lblUserInfo 
  51.       AutoSize        =   -1  'True
  52.       BackStyle       =   0  'Transparent
  53.       Caption         =   "Enter Age:"
  54.       Height          =   190
  55.       Index           =   1
  56.       Left            =   320
  57.       TabIndex        =   3
  58.       Top             =   820
  59.       Width           =   915
  60.    End
  61.    Begin Label lblUserInfo 
  62.       AutoSize        =   -1  'True
  63.       BackStyle       =   0  'Transparent
  64.       Caption         =   "Enter Name:"
  65.       Height          =   195
  66.       Index           =   0
  67.       Left            =   185
  68.       TabIndex        =   1
  69.       Top             =   345
  70.       Width           =   1065
  71.    End
  72. Dim sName As String
  73. Dim iAge As Integer
  74. Sub cmdShowDlg_Click (Index As Integer)
  75.   Select Case Index
  76.     Case 0  ' Using Variants
  77.       sName = txtUserInfo(0).Text
  78.       iAge = txtUserInfo(1).Text
  79.       VariantShowAge sName, iAge
  80.       'VariantShowAge iAge, sName
  81.     Case 1  ' Using Sting and Integer
  82.       sName = txtUserInfo(0).Text
  83.       iAge = txtUserInfo(1).Text
  84.       ExplicitShowAge sName, iAge
  85.       'ExplicitShowAge iAge, sName
  86.   End Select
  87. End Sub
  88. Sub Command1_Click (Index As Integer)
  89. End Sub
  90. Sub ExplicitShowAge (sName1 As String, iAge1 As Integer)
  91.   MsgBox sName1 & " is " & iAge1 & " years old.", 64, "Sample Output"
  92. End Sub
  93. Sub Form_Load ()
  94.   frmMain.Left = (Screen.Width - frmMain.Width) / 2
  95.   frmMain.Top = (Screen.Height - frmMain.Height) / 2
  96. End Sub
  97. Sub VariantShowAge (vAge1 As Variant, vName1 As Variant)
  98.   MsgBox vName1 & " is " & vAge1 & " years old.", 64, "Sample Output"
  99. End Sub
  100.